<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
</head>

<body>
    <div id="root">
        <!-- 普通写法 -->
        <!-- <span>单向数据绑定:</span><input type="text" v-bind:value="name"><br>
        <span>双向数据绑定:</span><input type="text" v-model:value="name"><br> -->

        <!-- 简写 -->
        <span>单向数据绑定:</span><input type="text" :value="name"><br>
        <span>双向数据绑定:</span><input type="text" v-model="name"><br>

        <!-- v-model的底层实现原理 -->
        <span>双向数据绑定:</span><input type="text" :value="name" @input="name=$event.target.value"><br>
    </div>
    <script>
        Vue.config.productionTip = false //取消生产提示
        new Vue({
            el: '#root',
            data() {
                return {
                    name: '尚硅谷'
                }
            }
        })
    </script>
</body>

</html>